#include "stdafx.h"
#include <iostream>
using namespace std;

class Buffer
{
	char buffer[300];
public:
	int pos;
public:
	Buffer::Buffer(int size)
	{
		buffer[size];

	}
	void WriteInt32(int val )
	{
		buffer[pos] = (char)val;
		buffer[pos + 1] = (char)(val >> 8);
		buffer[pos + 2] = (char)(val >> 16);
		buffer[pos + 3] = (char)(val >> 24);
		pos += 4;
	}
	int readInt32()
	{
		char data[4] = {buffer[pos],buffer[pos + 1],buffer[pos + 2],buffer[pos + 3]};
		pos += 4;
		return (int)(data + 3 ) << 24 | (int)(data + 2) << 16 | (int)(data + 1) << 8 | (int)data;
	}
}
;